]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Only show switch-user button for multiple users
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 7 Sep 2022 14:57:08 +0000 (16:57 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 30 Jan 2024 01:21:12 +0000 (01:21 +0000)
We don't offer "Switch user" on single-user systems when unlocked,
so it is a bit weird to include it while locked.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2475>

js/ui/unlockDialog.js

index 62b6cc3dc94ac511f87a1a1cd2c3ed480d618d26..0e56f6e7ddac62caaf12921161b775e841c48a52 100644 (file)
@@ -585,8 +585,10 @@ export const UnlockDialog = GObject.registerClass({
         this._lockdownSettings.connect('changed::disable-user-switching',
             this._updateUserSwitchVisibility.bind(this));
 
-        this._user.connectObject('notify::is-loaded',
-            this._updateUserSwitchVisibility.bind(this), this);
+        this._user.connectObject(
+            'notify::is-loaded', () => this._updateUserSwitchVisibility(),
+            'notify::has-multiple-users', () => this._updateUserSwitchVisibility(),
+            this);
 
         this._updateUserSwitchVisibility();
 
@@ -850,6 +852,7 @@ export const UnlockDialog = GObject.registerClass({
 
     _updateUserSwitchVisibility() {
         this._otherUserButton.visible = this._userManager.can_switch() &&
+            this._userManager.has_multiple_users &&
             this._screenSaverSettings.get_boolean('user-switch-enabled') &&
             !this._lockdownSettings.get_boolean('disable-user-switching');
     }